import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import JQuery from '../views/JQuery/JQuery.vue'
import Swiper from '../views/Swiper/Swiper.vue'
import Bootstrap from '../views/Bootstrap/Bootstrap.vue'
import Echarts from '../views/Echarts/Echarts.vue'
import Element from '../views/Element/Element.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/jquery',
    name: 'JQuery',
    component: JQuery
  },
  {
    path: '/swiper',
    name: 'Swiper',
    component: Swiper
  },
  {
    path: '/bootstrap',
    name: 'Bootstrap',
    component: Bootstrap
  },
  {
    path: '/echarts',
    name: 'Echarts',
    component: Echarts
  },
  {
    path: '/element',
    name: 'Element',
    component: Element
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
